package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 商品表
 * @TableName tb_prod
 */
@TableName(value ="tb_prod")
@Data
public class TbProd implements Serializable {
    /**
     * 商品ID
     */
    @TableId(type = IdType.AUTO)
    private Integer prodId;

    /**
     * 商品SPU
     */
    @NotBlank(message = "商品SPU不能为空")
    private String prodSpu;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空")
    private String prodName;

    /**
     * 商品分类
     */
    private Integer typeId;

    /**
     * 品牌ID
     */
    private Integer brandId;

    /**
     * 商品单位
     */
    private Integer unitId;

    /**
     * 商品标签
     */
    private Integer tagId;

    /**
     * 供应商ID
     */
    private Integer apprId;

    /**
     * 商品缩略图
     */
    private String prodImage;

    /**
     * 商品状态：0下架1上架
     */
    private Integer prodStatus;

    /**
     * 商品类型：0实物商品1虚拟商品2卡密/网盘
     */
    private Integer kindId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date createTime;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date updateTime;


    private String prodVideo;
    private Integer upType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date upTime;
    private Integer downType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date downTime;

    /**
     * 更新人
     */
    private String updateBy;

    @TableField(exist = false)
    private String typeName;

    @TableField(exist = false)
    private String brandName;

    @TableField(exist = false)
    private String unitName;

    @TableField(exist = false)
    private String tagName;

    @TableField(exist = false)
    private String apprName;

    @TableField(exist = false)
    private String kindName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}